﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Web.Mvc;
namespace RBAC.Web.Models
{
	public class UserModel
	{	
			    
					 //Autokey NOT PK
						[DisplayName("Id")]
						public int Id { get; set; }
									 
					 //Pk NOT Autokey
						[Required]
						[StringLength(255, ErrorMessage = "Username cannot be longer than 255 characters.")]
						[Remote("doesUsernameExist", "User", HttpMethod = "POST", AdditionalFields = "Mode, OldValue", ErrorMessage = "Username already exists. Please enter a different Username")]
						[DisplayName("Username")]
						public String Username { get; set; }
									 
					 
						[Required]
						[StringLength(255, ErrorMessage = "Password cannot be longer than 255 characters.")]
						[DisplayName("Password")]
						public String Password { get; set; }
									 
					 
						[Required]
						[StringLength(255, ErrorMessage = "Email cannot be longer than 255 characters.")]
						[DisplayName("E-mail")]
						public String Email { get; set; }
									 
					 
						[Required]
						[StringLength(255, ErrorMessage = "Mobile cannot be longer than 255 characters.")]
						[DisplayName("Mobile")]
						public String Mobile { get; set; }
									 
					 
						[Required]
						[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
						[DisplayName("Create Date")]
						public DateTime CreateDate { get; set; }
									 
																		[DisplayName("Role")]
							public int Role { get; set; }
																								public int RoleId { get; set; }
																																public String RoleRoleCode { get; set; }
																								 
					  
						[Required(ErrorMessage="Please select UserStatus")]
						[DisplayName("Status")]
						public int UserStatus { get; set; }

														
				// For PopLookup
				public List<UserModel> ListOfUser { get; set; }
				public string[] RequiredFields { get; set; }
	}
}